package com.woniuxy.feign;

import com.woniuxy.feign.hystrix.OrderHystrix;
import com.work.framework.pojo.ResultDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.math.BigDecimal;

/**
 * @Author: wanghao
 * @Date: 2019/9/19 15:42
 *
 * 订单模块远程调用
 */
@FeignClient(value = "order-server",fallback = OrderHystrix.class)
public interface OrderFeign {
    /**
     * 扣款
     * @param uid
     * @param money
     * @return
     */
    @PostMapping("/money/charge/{uid}/{money}")
     Integer chargeMoney(@PathVariable("uid") Integer uid,@PathVariable("money") BigDecimal money);

    /**
     * 加钱
     * @param uid
     * @param money
     * @return
     */
    @PostMapping("/money/add/{uid}/{money}")
    Integer addMoney(@PathVariable("uid") Integer uid,@PathVariable("money") BigDecimal money);

    /**生成订单
     * @return
     */
    @PostMapping("/order/addOrder/{bid}/{gid}/{transacPrice}")
    Integer addOrder(@PathVariable("bid") Integer bid, @PathVariable("gid") Integer gid,@PathVariable("transacPrice") BigDecimal transacPrice);
}
